<script>
export default {
  onLaunch: function (options) {
    console.log("## App onLaunch ##", options)
    try {
      this.loadPlatformInfo()
      // #ifdef APP-PLUS
      plus.screen.lockOrientation('portrait-primary')
      // 查看App SDK集成的第三方模块
      uni.getProvider({
        service: 'oauth',
        success: function (res) {
          console.log(res.provider)
        }
      })
      // #endif
    } catch (error) {
      console.error(error)
    }
  },
  onShow: function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  },
  methods: {
    // 初始化自定义导航栏相关参数
    loadPlatformInfo() {
      let e = uni.getSystemInfoSync()
      console.log("SystemInfo", e)
      this.$store.commit(this.$types.SYS_INFO, e)
      // weixin-ios, weixin-android, app-ios, app-android
      let type = ''
      if (e.platform === 'ios') {
        // #ifdef MP-WEIXIN
        type = 'weixin-ios'
        // #endif
        // #ifdef APP-PLUS
        type = 'app-ios'
        // #endif
      } else if (e.platform === 'android') {
        // #ifdef MP-WEIXIN
        type = 'weixin-android'
        // #endif
        // #ifdef APP-PLUS
        type = 'app-android'
        // #endif
      } else if (e.platform === 'devtools') {
        type = 'weixin-devtools'
      }
      this.$store.commit(this.$types.CLIENT_TYPE, type)
    },
  }
}
</script>

<style>
/*每个页面公共css */
/* 官方ui库 */
@import "/common/uni.css";
/* 第三方动画库 */
@import "/common/animate.css";
/* 自定义图标库 */
@import "/common/iconfont.css";
/* UI基础库 */
@import "/common/zcm-main.css";
/* 公共样式 */
@import "/common/common.css";
/*每个页面公共css */
</style>
